Defining functions and packages

# 1. Source functions ----

source("functions/graphical_par.R")
source("functions/theme_graph.R")
source("functions/pred_vbgf.R")

# 2. Required packages ----

library(tidyverse)
library(kableExtra)
library(formattable)
library(readxl)
library(plotly)
library(rfishbase)

# 3. Set theme_graph() as the default ggplot theme ----

theme_set(theme_graph())

# 4. Load data ----

data_complete <- read.csv("./../data/02_back-calculated-size-at-age_morat-et-al.csv")

1. Data exploration

1.1 Tables

1.1.1 Data with back-calc.

data_complete %>% 
  filter(!is.na(Li_sp_m)) %>% 
  summarize_at(vars("ID", "Species", "Family"), n_distinct, na.rm = TRUE) %>% 
  bind_rows(data_complete %>%
              filter(!is.na(Li_sploc_m)) %>% 
              summarize_at(vars("ID", "Species", "Family"), n_distinct, na.rm = TRUE), .) %>% 
  bind_rows(data_complete %>%
              summarize_at(vars("ID", "Species", "Family"), n_distinct, na.rm = TRUE), .) %>% 
  mutate(Type = c("All data", "Back-calculated sp. loc.", "Back-calculated sp."), .before = 1) %>% 
  kable(., 
        col.names = c("", "Individual", "Species", "Family"), 
        caption = "Table 1. Comparison of numbers of individuals, species and family for the overall dataset and for back-calculated data (by species, and by species and location).") %>% 
  kable_styling(bootstrap_options = c("striped", "hover"))
Table 1. Comparison of numbers of individuals, species and family for the overall dataset and for back-calculated data (by species, and by species and location).
Individual Species Family
All data 855 51 16
Back-calculated sp. loc. 669 44 16
Back-calculated sp. 710 45 16

1.1.2 Individual by species

data_complete %>%
  filter(!is.na(Li_sp_m)) %>% 
  group_by(Species) %>% 
  summarise(n = length(unique(ID)),
        min_lencap = round(min(Lcpt, na.rm = TRUE), 0),
        max_lencap = round(max(Lcpt, na.rm = TRUE), 0),
        max_age = max(Agei, na.rm = TRUE)) %>% 
  kable(., 
        col.names = c("Species", "n", "Min length (TL, mm)", "Max length (TL, mm)", "Age max (years)"),
        caption = "Table 2. Number of individuals, minimum and maximum total length (mm) and maximum age, by species. Only individuals with back-calculated data by species are shown.") %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  column_spec(1, italic = T)
Table 2. Number of individuals, minimum and maximum total length (mm) and maximum age, by species. Only individuals with back-calculated data by species are shown.
Species n Min length (TL, mm) Max length (TL, mm) Age max (years)
Abudefduf sexfasciatus 13 61 172 13
Acanthurus achilles 16 138 246 27
Acanthurus lineatus 8 123 362 23
Acanthurus nigricans 8 150 210 9
Acanthurus pyroferus 6 195 230 19
Acanthurus triostegus 18 147 194 12
Balistapus undulatus 17 70 283 18
Caranx melampygus 7 368 712 15
Centropyge bispinosa 7 36 80 11
Centropyge flavissima 26 48 150 27
Cephalopholis argus 41 120 450 21
Cephalopholis urodeta 8 150 214 17
Chaetodon citrinellus 7 64 101 6
Chaetodon ornatissimus 10 122 175 10
Chlorurus spilurus 31 183 344 16
Chromis iomelas 15 41 61 5
Chromis viridis 6 115 148 9
Ctenochaetus marginatus 15 99 270 13
Ctenochaetus striatus 26 153 218 17
Dascyllus aruanus 20 51 71 7
Dascyllus flavicaudus 8 89 104 13
Epibulus insidiator 17 157 350 16
Epinephelus fasciatus 10 123 256 13
Epinephelus hexagonatus 14 160 268 14
Epinephelus merra 46 108 261 17
Epinephelus polyphekadion 14 252 514 20
Gnathodentex aureolineatus 8 197 255 17
Gymnosarda unicolor 4 499 985 7
Halichoeres trimaculatus 7 123 186 5
Lutjanus fulvus 12 195 289 21
Lutjanus kasmira 10 115 326 30
Mulloidichthys flavolineatus 14 257 311 6
Myripristis berndti 30 147 279 24
Naso lituratus 17 228 432 10
Odonus niger 17 176 350 16
Ostorhinchus angustatus 15 46 83 6
Ostorhinchus apogonoides 27 58 96 7
Parupeneus barberinus 6 228 496 6
Plectropomus laevis 30 399 957 22
Pristiapogon taeniopterus 28 53 104 8
Sargocentron microstoma 22 62 204 13
Scarus psittacus 7 195 311 6
Siganus argenteus 11 236 388 13
Stegastes nigricans 13 55 138 13
Zebrasoma scopas 18 110 166 24

1.1.3 Individuals by location

data_complete %>%
  filter(!is.na(Li_sp_m)) %>% 
  group_by(Species, Location) %>% 
  summarise(n = length(unique(ID))) %>% 
  pivot_wider(names_from = Location, values_from = n) %>% 
  mutate(Gambiers = cell_spec(Gambiers, "html", color = ifelse(is.na(Gambiers), "white", "#446CB3")),
         Hao = cell_spec(Hao, "html", color = ifelse(is.na(Hao), "white", "#446CB3")),
         Marquesas = cell_spec(Marquesas, "html", color = ifelse(is.na(Marquesas), "white", "#446CB3")),
         Moorea = cell_spec(Moorea, "html", color = ifelse(is.na(Moorea), "white", "#446CB3")),
         Manuae = cell_spec(Manuae, "html", color = ifelse(is.na(Manuae), "white", "#446CB3")),
         Tuamotu = cell_spec(Tuamotu, "html", color = ifelse(is.na(Tuamotu), "white", "#446CB3"))) %>% 
  kable(., 
        format = "html", escape = FALSE,
        caption = "Table 3. Number of individuals of each species by location. Only individuals with back-calculated data (by species) are shown.") %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  column_spec(1, italic = T)
Table 3. Number of individuals of each species by location. Only individuals with back-calculated data (by species) are shown.
Species Gambiers Moorea Manuae Marquesas Tuamotu Hao
Abudefduf sexfasciatus 11 2 NA NA NA NA
Acanthurus achilles 6 NA 10 NA NA NA
Acanthurus lineatus NA NA NA 8 NA NA
Acanthurus nigricans NA NA NA 8 NA NA
Acanthurus pyroferus NA NA NA 6 NA NA
Acanthurus triostegus 3 11 NA 4 NA NA
Balistapus undulatus NA 12 NA 5 NA NA
Caranx melampygus NA 5 NA NA 2 NA
Centropyge bispinosa NA 7 NA NA NA NA
Centropyge flavissima 9 5 NA 12 NA NA
Cephalopholis argus 6 10 NA NA 10 15
Cephalopholis urodeta 8 NA NA NA NA NA
Chaetodon citrinellus NA 7 NA NA NA NA
Chaetodon ornatissimus 4 NA NA 6 NA NA
Chlorurus spilurus 13 16 NA NA 2 NA
Chromis iomelas NA 15 NA NA NA NA
Chromis viridis 6 NA NA NA NA NA
Ctenochaetus marginatus NA NA NA 15 NA NA
Ctenochaetus striatus 11 15 NA NA NA NA
Dascyllus aruanus NA 20 NA NA NA NA
Dascyllus flavicaudus 8 NA NA NA NA NA
Epibulus insidiator 12 5 NA NA NA NA
Epinephelus fasciatus NA NA NA 10 NA NA
Epinephelus hexagonatus NA NA NA NA NA 14
Epinephelus merra 13 20 NA NA NA 13
Epinephelus polyphekadion NA NA NA NA NA 14
Gnathodentex aureolineatus 8 NA NA NA NA NA
Gymnosarda unicolor 4 NA NA NA NA NA
Halichoeres trimaculatus 6 1 NA NA NA NA
Lutjanus fulvus NA 6 NA NA 6 NA
Lutjanus kasmira 2 NA NA 8 NA NA
Mulloidichthys flavolineatus NA 14 NA NA NA NA
Myripristis berndti 7 15 NA 8 NA NA
Naso lituratus 11 6 NA NA NA NA
Odonus niger NA 13 NA 4 NA NA
Ostorhinchus angustatus NA 15 NA NA NA NA
Ostorhinchus apogonoides NA NA NA 27 NA NA
Parupeneus barberinus 5 NA NA 1 NA NA
Plectropomus laevis 12 NA NA NA NA 18
Pristiapogon taeniopterus NA NA NA 28 NA NA
Sargocentron microstoma NA 17 NA 5 NA NA
Scarus psittacus NA 2 NA NA 5 NA
Siganus argenteus 6 2 NA NA 3 NA
Stegastes nigricans 3 10 NA NA NA NA
Zebrasoma scopas 5 13 NA NA NA NA

1.1.4 Number of NA

# 1. Number of NA by variable

data_complete %>%
  summarise_all(~(sum(is.na(.)))) %>% 
  t(.) %>% 
  as.data.frame() %>% 
  kable(., col.names = c("NA"), caption = "Table 4. Number of rows with Non-Available (NA) data by variable") %>% 
  kable_styling(bootstrap_options = c("striped", "hover"))
Table 4. Number of rows with Non-Available (NA) data by variable
NA
Family 0
Genus 0
Species 0
ID 0
Agei 0
Ri 387
Agecpt 0
Rcpt 0
Lcpt 0
L0p 0
R0p 2811
Li_sp_m 410
Li_sp_sd 410
Li_sploc_m 757
Li_sploc_sd 757
Weight 603
Location 0
Observer 0

1.2 Plot

1.2.1 Agei vs Li (sp.)

data_complete %>% 
  filter(!is.na(Li_sp_m)) %>% # Remove individuals with non back-calculated data
  ggplot(., aes(x = Agei, y = Li_sp_m)) +
  geom_point(color = col_color_graph, fill = col_fill_graph, size = 1, shape = 21)+
  theme(strip.text.x = element_text(size = 8, face = "italic"),
        strip.background = element_rect(colour = "black", fill = col_facet, size = 1),
        plot.title = element_text(colour = col_color_graph),
        plot.subtitle = element_text(colour = "black"),
        strip.text.y = element_text(angle = 360, face = "italic")) +
  facet_wrap(~Species, scales = "free", ncol = 5) +
  labs(x = "Age (years)", y = "Length (mm)")
Figure 1. Relation between length (TL, mm) and age, by species.

Figure 1. Relation between length (TL, mm) and age, by species.

1.2.2 Agei vs Li (sp. and loc.)

data_complete %>% 
  filter(!is.na(Li_sploc_m)) %>% # Remove individuals with non back-calculated data
  ggplot(., aes(x = Agei, y = Li_sploc_m)) +
  geom_point(color = col_color_graph, fill = col_fill_graph, size = 1, shape = 21)+
  theme(strip.text.x = element_text(size = 8),
        strip.background = element_rect(colour = "black", fill = col_facet, size = 1),
        plot.title = element_text(colour = col_color_graph),
        plot.subtitle = element_text(colour = "black"),
        strip.text.y = element_text(angle = 360, face = "italic")) +
  facet_grid(Species~Location, scales = "free") +
  labs(x = "Age (years)", y = "Length (mm)")
Figure 2. Relation between length (TL, mm) and age, by species and location.

Figure 2. Relation between length (TL, mm) and age, by species and location.

2. VBGF results

2.1 Growth parameters (sp.)

# 1. Growth parameters (on back-calculated data by species) ----

read.csv("./../data/03_back-calculated_vbgf_predictions_sp.csv") %>% 
  mutate(Estimate = paste0(round(Estimate, 3), " (", round(Est.Error, 3), ")")) %>% 
  pivot_wider("Species", names_from = Parameter, values_from = Estimate) %>% 
  select(Species, linf, k, t0) %>% 
  arrange(Species) %>% 
  kable(., 
        col.names = c("Species", "Linf", "K", "t0"), 
        caption = "Table 5. Values of Von Bertalanffy parameters estimated on back-calculated data through Bayesian framework by species. Standard deviation are the values in parentheses. Linf is expressed in TL and cm.") %>% 
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  column_spec(1, italic = T)
Table 5. Values of Von Bertalanffy parameters estimated on back-calculated data through Bayesian framework by species. Standard deviation are the values in parentheses. Linf is expressed in TL and cm.
Species Linf K t0
Abudefduf sexfasciatus 14.846 (0.407) 1.102 (0.106) -0.027 (0.025)
Acanthurus achilles 18.509 (0.806) 1.185 (0.153) -0.023 (0.024)
Acanthurus lineatus 26.003 (1.769) 0.916 (0.182) -0.044 (0.051)
Acanthurus nigricans 17.134 (0.968) 1.479 (0.212) -0.011 (0.016)
Acanthurus pyroferus 19.594 (1.096) 0.786 (0.145) -0.07 (0.067)
Acanthurus triostegus 15.754 (0.384) 0.738 (0.062) -0.064 (0.032)
Balistapus undulatus 18.968 (1.875) 0.338 (0.057) -0.28 (0.093)
Caranx melampygus 54.164 (4.165) 0.248 (0.04) -0.193 (0.085)
Centropyge bispinosa 5.216 (0.824) 0.958 (0.938) -0.066 (0.034)
Centropyge flavissima 9.82 (0.668) 0.422 (0.077) -0.21 (0.078)
Cephalopholis argus 29.803 (1.204) 0.398 (0.021) -0.252 (0.041)
Cephalopholis urodeta 20.912 (1.291) 0.142 (0.022) -0.605 (0.101)
Chaetodon ornatissimus 14.523 (0.682) 1.006 (0.143) -0.026 (0.036)
Chlorurus spilurus 22.758 (0.834) 1.049 (0.106) -0.023 (0.022)
Chromis iomelas 5.002 (0.35) 1.297 (0.235) -0.052 (0.021)
Chromis viridis 11.961 (1.086) 0.949 (0.236) -0.049 (0.05)
Ctenochaetus marginatus 20.748 (1.626) 0.428 (0.047) -0.133 (0.043)
Ctenochaetus striatus 17.1 (0.385) 0.851 (0.053) -0.045 (0.022)
Dascyllus aruanus 5.588 (0.21) 0.966 (0.102) -0.05 (0.025)
Dascyllus flavicaudus 8.948 (0.433) 0.504 (0.058) -0.153 (0.057)
Epibulus insidiator 23.788 (1.344) 0.542 (0.067) -0.123 (0.052)
Epinephelus fasciatus 20.4 (1.7) 0.718 (0.112) -0.038 (0.029)
Epinephelus hexagonatus 21.366 (0.909) 0.634 (0.069) -0.068 (0.042)
Epinephelus merra 17.617 (0.752) 0.859 (0.058) -0.045 (0.018)
Epinephelus polyphekadion 38.026 (1.93) 0.299 (0.034) -0.25 (0.093)
Gnathodentex aureolineatus 20.182 (0.846) 0.546 (0.074) -0.156 (0.081)
Halichoeres trimaculatus 17.9 (1.669) 0.653 (0.146) -0.034 (0.055)
Lutjanus fulvus 23.923 (0.93) 0.671 (0.083) -0.087 (0.053)
Mulloidichthys flavolineatus 25.761 (0.56) 1.601 (0.112) -0.008 (0.009)
Myripristis berndti 20.118 (0.718) 0.418 (0.032) -0.236 (0.052)
Naso lituratus 29.808 (1.729) 1.846 (0.239) -0.004 (0.009)
Odonus niger 25.093 (1.24) 0.459 (0.053) -0.14 (0.05)
Ostorhinchus angustatus 7.195 (0.349) 0.69 (0.089) -0.109 (0.036)
Ostorhinchus apogonoides 8.241 (0.217) 0.836 (0.052) -0.073 (0.014)
Plectropomus laevis 71.842 (3.023) 0.318 (0.03) -0.194 (0.056)
Pristiapogon taeniopterus 8.024 (0.283) 0.779 (0.069) -0.094 (0.027)
Sargocentron microstoma 16.26 (0.56) 0.657 (0.054) -0.056 (0.028)
Siganus argenteus 30.309 (3.329) 0.614 (0.135) -0.056 (0.054)
Stegastes nigricans 12.04 (0.789) 0.403 (0.072) -0.2 (0.114)

2.2 Growth parameters (sp. loc.)

# 1. Growth parameters (on back-calculated data by species and locations) ----

read.csv("./../data/03_back-calculated_vbgf_predictions_sploc.csv") %>% 
  mutate(Estimate = paste0(round(Estimate, 3), " (", round(Est.Error, 3), ")")) %>% 
  pivot_wider(c("Species", Location), names_from = Parameter, values_from = Estimate) %>% 
  select(Species, Location, linf, k, t0) %>% 
  arrange(Species) %>% 
  kable(., 
        col.names = c("Species", "Location", "Linf", "K", "t0"), 
        caption = "Table 6. Values of Von Bertalanffy parameters estimated on back-calculated data through Bayesian framework by species and location. Standard deviation are the values in parentheses. Linf is expressed in TL and cm.") %>% 
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  column_spec(1, italic = T)
Table 6. Values of Von Bertalanffy parameters estimated on back-calculated data through Bayesian framework by species and location. Standard deviation are the values in parentheses. Linf is expressed in TL and cm.
Species Location Linf K t0
Abudefduf sexfasciatus Gambiers 14.837 (0.393) 1.103 (0.104) -0.027 (0.024)
Acanthurus achilles Manuae 19.44 (0.642) 1.203 (0.14) -0.021 (0.025)
Acanthurus lineatus Marquesas 24.726 (2.413) 1.044 (0.255) -0.029 (0.039)
Acanthurus nigricans Marquesas 17.06 (1.02) 1.495 (0.226) -0.011 (0.015)
Acanthurus pyroferus Marquesas 19.561 (1.02) 0.788 (0.142) -0.07 (0.068)
Acanthurus triostegus Moorea 15.673 (0.476) 0.742 (0.073) -0.067 (0.038)
Balistapus undulatus Marquesas 19.329 (2.174) 0.413 (0.151) -0.254 (0.173)
Balistapus undulatus Moorea 17.235 (1.905) 0.376 (0.066) -0.237 (0.096)
Caranx melampygus Moorea 54.835 (4.393) 0.242 (0.042) -0.167 (0.102)
Centropyge bispinosa Moorea 5.253 (0.849) 0.926 (0.565) -0.066 (0.036)
Centropyge flavissima Marquesas 6.773 (0.573) 1.076 (0.209) -0.033 (0.021)
Centropyge flavissima Moorea 8.175 (0.757) 1.262 (0.329) -0.028 (0.026)
Centropyge flavissima Gambiers 12.21 (1.244) 0.204 (0.041) -0.834 (0.252)
Cephalopholis argus Moorea 22.852 (2.469) 0.728 (0.149) -0.068 (0.052)
Cephalopholis argus Tuamotu 27.447 (1.451) 0.439 (0.064) -0.225 (0.099)
Cephalopholis argus Gambiers 40.416 (1.071) 0.297 (0.031) -0.45 (0.14)
Cephalopholis argus Hao 32.317 (1.775) 0.401 (0.035) -0.184 (0.058)
Cephalopholis urodeta Gambiers 20.981 (1.278) 0.141 (0.021) -0.604 (0.102)
Chaetodon ornatissimus Marquesas 14.599 (1.148) 1.077 (0.261) -0.022 (0.043)
Chlorurus spilurus Moorea 22.998 (1.313) 1.245 (0.214) -0.016 (0.03)
Chlorurus spilurus Gambiers 22.585 (1.059) 0.925 (0.12) -0.037 (0.032)
Chromis iomelas Moorea 4.994 (0.355) 1.301 (0.247) -0.052 (0.021)
Chromis viridis Gambiers 11.953 (1.072) 0.951 (0.228) -0.048 (0.051)
Ctenochaetus marginatus Marquesas 20.934 (1.533) 0.424 (0.043) -0.135 (0.046)
Ctenochaetus striatus Moorea 17.326 (0.566) 1.142 (0.098) -0.021 (0.016)
Ctenochaetus striatus Gambiers 16.99 (0.543) 0.566 (0.051) -0.112 (0.049)
Dascyllus aruanus Moorea 5.589 (0.201) 0.964 (0.101) -0.05 (0.025)
Dascyllus flavicaudus Gambiers 8.992 (0.403) 0.498 (0.054) -0.152 (0.059)
Epibulus insidiator Gambiers 23.859 (1.327) 0.539 (0.066) -0.123 (0.052)
Epinephelus fasciatus Marquesas 20.354 (1.664) 0.721 (0.117) -0.038 (0.03)
Epinephelus hexagonatus Hao 21.337 (0.907) 0.636 (0.068) -0.067 (0.043)
Epinephelus merra Moorea 14.078 (0.864) 1.192 (0.098) -0.016 (0.014)
Epinephelus merra Gambiers 18.52 (0.887) 0.655 (0.08) -0.093 (0.052)
Epinephelus merra Hao 22.481 (0.617) 0.842 (0.084) -0.043 (0.034)
Epinephelus polyphekadion Hao 38.812 (2.245) 0.248 (0.024) -0.332 (0.083)
Gnathodentex aureolineatus Gambiers 20.151 (0.881) 0.547 (0.076) -0.155 (0.079)
Halichoeres trimaculatus Gambiers 17.844 (1.584) 0.655 (0.157) -0.036 (0.058)
Lutjanus fulvus Moorea 21.82 (1.598) 1.175 (0.244) -0.019 (0.025)
Lutjanus fulvus Tuamotu 24.765 (1.386) 0.476 (0.076) -0.215 (0.11)
Mulloidichthys flavolineatus Moorea 25.762 (0.535) 1.601 (0.108) -0.008 (0.009)
Myripristis berndti Gambiers 23.324 (1.519) 0.338 (0.058) -0.391 (0.157)
Myripristis berndti Marquesas 21.795 (0.496) 0.378 (0.036) -0.298 (0.101)
Myripristis berndti Moorea 17.458 (0.9) 0.553 (0.064) -0.11 (0.044)
Naso lituratus Gambiers 31.83 (1.758) 1.718 (0.227) -0.005 (0.011)
Odonus niger Moorea 22.957 (1.147) 0.588 (0.071) -0.08 (0.041)
Ostorhinchus angustatus Moorea 7.216 (0.356) 0.686 (0.089) -0.11 (0.036)
Ostorhinchus apogonoides Marquesas 8.226 (0.217) 0.839 (0.053) -0.073 (0.014)
Plectropomus laevis Gambiers 77.388 (3.133) 0.253 (0.023) -0.408 (0.097)
Plectropomus laevis Hao 52.309 (2.535) 0.682 (0.054) -0.012 (0.019)
Pristiapogon taeniopterus Marquesas 8.025 (0.275) 0.778 (0.069) -0.093 (0.027)
Sargocentron microstoma Moorea 16.263 (0.542) 0.656 (0.052) -0.056 (0.027)
Siganus argenteus Gambiers 26.724 (2.244) 0.53 (0.098) -0.091 (0.067)
Stegastes nigricans Moorea 12.006 (0.886) 0.409 (0.099) -0.199 (0.11)

2.3 Growth curves (sp.)

# 1. Growth curves ----

read.csv("./../data/03_back-calculated_vbgf_fitted_sp.csv") %>% 
  ggplot(data = .) +
    geom_ribbon(aes(x = age, ymin = ypred_lq, ymax = ypred_uq), alpha = 0.5, fill = col_fill_graph, alpha = 0.6) +
    geom_line(aes(x = age, y = ypred_m), color = col_color_graph) +
    geom_point(data = data_complete %>%
                 filter(Species %in% unique(read.csv("./../data/03_back-calculated_vbgf_fitted_sp.csv")$Species)) %>% 
                 mutate(Li_sp_m = Li_sp_m/10), 
               aes(x = Agei, y = Li_sp_m), color = col_color_graph, fill = col_fill_graph, size = 1, shape = 21) +
    facet_wrap(~Species, scales = "free", ncol = 5) +
    lims(y = c(0, NA)) +
    theme(strip.text.x = element_text(face = "italic")) +
    labs(x = "Age (years)", y = "Length (TL, cm)") +
    guides(colour = guide_legend(override.aes = list(alpha = 1, size = 0.5)))
Figure 3. Growth curves on back-calculated data by species.

Figure 3. Growth curves on back-calculated data by species.

2.4 Growth curves (sp. loc.)

# 1. Growth curves ----

read.csv("./../data/03_back-calculated_vbgf_fitted_sploc.csv") %>% 
  ggplot(data = .) +
    geom_ribbon(aes(x = age, ymin = ypred_lq, ymax = ypred_uq, fill = Location), alpha = 0.5, show.legend = FALSE) +
    geom_line(aes(x = age, y = ypred_m, color = Location), show.legend = FALSE) +
    geom_point(data = data_complete %>%
                 filter(Species %in% unique(read.csv("./../data/03_back-calculated_vbgf_fitted_sploc.csv")$Species)) %>% 
                 mutate(Li_sploc_m = Li_sploc_m/10), 
               aes(x = Agei, y = Li_sploc_m, color = Location), size = 1, show.legend = FALSE) +
    facet_grid(Species~Location, scales = "free") +
    lims(y = c(0, NA)) +
    labs(x = "Age (years)", y = "Length (TL, cm)") +
    theme(strip.text.x = element_text(size = 8),
          strip.background = element_rect(colour = "black", fill = col_facet, size = 1),
          plot.title = element_text(colour = col_color_graph),
          plot.subtitle = element_text(colour = "black"),
          strip.text.y = element_text(angle = 360, face = "italic"))
Figure 4. Growth curves on back-calculated data by species and location.

Figure 4. Growth curves on back-calculated data by species and location.

3. Raw vs Back-calculation

3.1 Growth curves (sp.)

# 1. List of species with enough individuals for one location ----

species_list <- c("Abudefduf sexfasciatus", "Acanthurus achilles", "Acanthurus pyroferus", 
                  "Acanthurus triostegus", "Balistapus undulatus", "Centropyge flavissima",
                  "Chaetodon ornatissimus", "Chromis iomelas", "Ctenochaetus marginatus",
                  "Dascyllus aruanus", "Epinephelus hexagonatus", "Myripristis berndti",
                  "Odonus niger", "Ostorhinchus angustatus", "Ostorhinchus apogonoides",
                  "Pristiapogon taeniopterus", "Sargocentron microstoma", "Stegastes nigricans")

# 1. Transform the raw data ----

# 1.1 Points --

data_raw_points <- read.csv("./../data/02_back-calculated-size-at-age_morat-et-al.csv") %>%
  filter(Species %in% species_list) %>% 
  select(Family, Genus, Species, ID, Agecpt, Lcpt, Location, Observer) %>% 
  unique() %>%
  dplyr::group_by(Species, Location) %>%
  dplyr::mutate(n = length(unique(ID))) %>%
  filter(n >= 10) %>% # filter with at least 10 replicates
  ungroup() %>% 
  dplyr::mutate(Lcpt = Lcpt/10) %>%  # Convert to cm
  mutate(Type = "Population-level data")

# 1.2 Curves -- 

data_raw_curve <- read.csv("./../data/03_raw_vbgf_fitted_sp.csv") %>% 
  filter(Species %in% species_list) %>% 
  mutate(Type = "Population-level data")

# 2. Transform the back-calculated data ----

# 2.1 Points --

data_backcalc_points <- read.csv("./../data/02_back-calculated-size-at-age_morat-et-al.csv") %>% 
  filter(Species %in% species_list) %>% 
  dplyr::mutate(Li_sp_m = Li_sp_m/10) %>%  # Convert to cm
  mutate(Type = "Back-calculated data")

# 2.2 Curves --

data_backcalc_curve <- read.csv("./../data/03_back-calculated_vbgf_fitted_sp.csv") %>% 
  filter(Species %in% species_list) %>% 
  mutate(Type = "Back-calculated data")

# 2. Make the plot ----

ggplot() +
  # Raw data
  geom_ribbon(data = data_raw_curve, aes(x = Agei, ymin = Q2.5, ymax = Q97.5, fill = Type), alpha = 0.5) +
  geom_line(data = data_raw_curve, aes(x = Agei, y = Estimate, color = Type), show.legend = FALSE) +
  geom_point(data = data_raw_points, aes(x = Agecpt, y = Lcpt, color = Type), size = 1) +
  # Back-calculated data
  geom_ribbon(data = data_backcalc_curve, aes(x = age, ymin = ypred_lq, ymax = ypred_uq, fill = Type), alpha = 0.5) +
  geom_line(data = data_backcalc_curve, aes(x = age, y = ypred_m, color = Type), show.legend = FALSE) +
  geom_point(data = data_backcalc_points, aes(x = Agei, y = Li_sp_m, color = Type), size = 1) +
  # Appearance
  facet_wrap(~Species, scales = "free", ncol = 3) +
  lims(y = c(0, NA)) +
  theme(strip.text.x = element_text(face = "italic"),
        legend.position = "top",
        legend.title = element_blank()) +
  labs(x = "Age (years)", y = "Length (TL, cm)") +
  lims(y = c(0, NA), x = c(0, NA)) +
  scale_color_manual(values = c(col_color_graph, "#d91e18")) +
  scale_fill_manual(values = c(col_fill_graph, "#e74c3c")) +
  guides(colour = guide_legend(override.aes = list(alpha = 1, size = 0.5)))
Figure 5. Comparison of growth curves by species between back-calculated data and population-level data.

Figure 5. Comparison of growth curves by species between back-calculated data and population-level data.

# 3. Remove useless objects ----

rm(data_raw_points, data_raw_curve, data_backcalc_points, data_backcalc_curve)

3.2 Growth curves (sp. loc.)

# 1. Transform the raw data ----

species_list2 <- species_list[!species_list %in% c("Balistapus undulatus", "Centropyge flavissima", "Chaetodon ornatissimus")]

# 1.1 Points --

data_raw_points <- read.csv("./../data/02_back-calculated-size-at-age_morat-et-al.csv") %>%
  filter(Species %in% species_list2) %>% 
  select(Family, Genus, Species, ID, Agecpt, Lcpt, Location, Observer) %>% 
  unique() %>%
  dplyr::group_by(Species, Location) %>%
  dplyr::mutate(n = length(unique(ID))) %>%
  filter(n >= 10) %>% # filter with at least 10 replicates
  ungroup() %>% 
  dplyr::mutate(Lcpt = Lcpt/10) %>%  # Convert to cm
  mutate(Type = "Raw")

# 1.2 Curves -- 

data_raw_curve <- read.csv("./../data/03_raw_vbgf_fitted_sploc.csv") %>% 
  filter(Species %in% species_list2) %>% 
  mutate(Type = "Raw")

# 2. Transform the back-calculated data ----

# 2.1 Points --

data_backcalc_points <- read.csv("./../data/02_back-calculated-size-at-age_morat-et-al.csv") %>% 
  filter(Species %in% species_list2,
         !(Species == "Abudefduf sexfasciatus" & Location == "Moorea"),
         !(Species == "Acanthurus triostegus" & Location == "Marquesas"),
         !(Species == "Myripristis berndti" & Location == "Gambiers"),
         !(Species == "Myripristis berndti" & Location == "Marquesas")) %>% 
  dplyr::mutate(Li_sploc_m = Li_sploc_m/10) %>%  # Convert to cm
  mutate(Type = "Back-calculated")

# 2.2 Curves --

data_backcalc_curve <- read.csv("./../data/03_back-calculated_vbgf_fitted_sploc.csv") %>% 
  filter(Species %in% species_list2,
         !(Species == "Abudefduf sexfasciatus" & Location == "Moorea"),
         !(Species == "Acanthurus triostegus" & Location == "Marquesas"),
         !(Species == "Myripristis berndti" & Location == "Gambiers"),
         !(Species == "Myripristis berndti" & Location == "Marquesas")) %>% 
  mutate(Type = "Back-calculated")

# 2. Make the plot ----

ggplot() +
  # Raw data
  geom_ribbon(data = data_raw_curve, aes(x = Agei, ymin = Q2.5, ymax = Q97.5, fill = Type), alpha = 0.5) +
  geom_line(data = data_raw_curve, aes(x = Agei, y = Estimate, color = Type), show.legend = FALSE) +
  #geom_point(data = data_raw_points, aes(x = Agecpt, y = Lcpt, color = Type), size = 1) +
  # Back-calculated data
  geom_ribbon(data = data_backcalc_curve, aes(x = age, ymin = ypred_lq, ymax = ypred_uq, fill = Type), alpha = 0.5) +
  geom_line(data = data_backcalc_curve, aes(x = age, y = ypred_m, color = Type), show.legend = FALSE) +
  #geom_point(data = data_backcalc_points, aes(x = Agei, y = Li_sploc_m, color = Type), size = 1) +
  # Appearance
  facet_wrap(~Species, scales = "free", ncol = 3) +
  lims(y = c(0, NA)) +
  theme(strip.text.x = element_text(face = "italic"),
        legend.position = "top",
        legend.title = element_blank()) +  labs(x = "Age (years)", y = "Length (TL, cm)") +
  lims(y = c(0, NA), x = c(0, NA)) +
  scale_color_manual(values = c(col_color_graph, "#d91e18")) +
  scale_fill_manual(values = c(col_fill_graph, "#e74c3c")) +
  guides(colour = guide_legend(override.aes = list(alpha = 1, size = 0.5)))
Figure 6. Comparison of growth curves by species and location (one location only by growth curve) between back-calculated data and population-level data.

Figure 6. Comparison of growth curves by species and location (one location only by growth curve) between back-calculated data and population-level data.

# 3. Save the plot ----

ggsave("./../figs/01_comparison-growth-curves-raw-vas-back-calculated.png", height = 15, width = 10) # PNG
ggsave("./../figs/01_comparison-growth-curves-raw-vas-back-calculated.eps", height = 15, width = 10) # PDF

# 4. Remove useless objects ----

rm(data_raw_points, data_raw_curve, data_backcalc_points, data_backcalc_curve)

4. Comparison with literature

# 1. Import file synthesizing the VBGF parameters from literature ----

vbgf_literature <- read_excel("./../data/00_von-bertalanffy-literature.xlsx", sheet = 1) %>% 
  dplyr::mutate(Linf = ifelse(Size_unit == "mm", Linf/10, Linf),
                Size_max = ifelse(Size_unit == "mm", Size_max/10, Size_max)) %>% # Convert all length values to cm
  select(-Family, -Genus) # Remove Family and Genus to add those level through fishbase

# 2. Check validity of species names ----

vbgf_literature <- vbgf_literature %>% 
  rowwise() %>% 
  dplyr::mutate(Species2 = ifelse(is_empty(validate_names(Species)) == TRUE, 
                           NA, 
                           validate_names(Species))) %>% # Correct the names through fishbase
  ungroup() %>% 
  dplyr::mutate(Species = str_replace_all(Species, c("Acanthurus chirugus" = "Acanthurus chirurgus",
                                                     "Scarus psitticus" = "Scarus psittacus"))) %>% # Correct unfound names
  filter(Species %in% unique(data_complete$Species)) %>% 
  mutate(Reference = paste0(Reference, " (", Reference_type, ")")) %>%
  mutate_at(c("Linf", "K", "t0"), as.character) %>% 
  select(-Size_unit, -Sex, -Reference_type, -Species2) %>% 
  arrange(Species)

4.1 Growth parameters

4.1.1 Table

# 1. Comparison of VBGF parameters between our study and literature ----

read.csv("./../data/03_back-calculated_vbgf_predictions_sp.csv") %>% 
  mutate(Estimate = paste0(round(Estimate, 3), " (", round(Est.Error, 3), ")")) %>% 
  pivot_wider(c("Species"), names_from = Parameter, values_from = Estimate) %>% 
  select(Species, linf, k, t0) %>% 
  rename(Linf = linf, K = k) %>% 
  mutate(Reference = "This study") %>% 
  full_join(., vbgf_literature) %>%
  select(Species, Linf, K, t0, Reference) %>% 
  arrange(Species) %>% 
  kable(.,
        format = "html", escape = FALSE,
        col.names = c("Species", "Linf", "K", "t0", "Reference"), 
        caption = "Table 6. Comparison between growth parameters estimated by species through Bayesian framework, with data from literature.") %>% 
  kable_styling(bootstrap_options = c("striped", "hover")) %>%
  column_spec(1, italic = T)
Table 6. Comparison between growth parameters estimated by species through Bayesian framework, with data from literature.
Species Linf K t0 Reference
Abudefduf sexfasciatus 14.846 (0.407) 1.102 (0.106) -0.027 (0.025) This study
Acanthurus achilles 18.509 (0.806) 1.185 (0.153) -0.023 (0.024) This study
Acanthurus lineatus 26.003 (1.769) 0.916 (0.182) -0.044 (0.051) This study
Acanthurus lineatus 18.274 0.462 -0.32 Choat and Robertson, 2002 (Article)
Acanthurus lineatus 22.1 0.12 -15.6 Craig et al, 1997 (Article)
Acanthurus lineatus 18.909 0.68 NA Gust et al, 2002 (Article)
Acanthurus lineatus 17.484 0.34 NA Gust et al, 2002 (Article)
Acanthurus lineatus 17 0.416 -0.329 Ralston and Williams, 1988 (Report)
Acanthurus nigricans 17.134 (0.968) 1.479 (0.212) -0.011 (0.016) This study
Acanthurus nigricans 14.286 0.28 -0.69 Choat and Robertson, 2002 (Article)
Acanthurus pyroferus 19.594 (1.096) 0.786 (0.145) -0.07 (0.067) This study
Acanthurus triostegus 15.754 (0.384) 0.738 (0.062) -0.064 (0.032) This study
Balistapus undulatus 18.968 (1.875) 0.338 (0.057) -0.28 (0.093) This study
Caranx melampygus 54.164 (4.165) 0.248 (0.04) -0.193 (0.085) This study
Caranx melampygus 89.7 0.233 -0.044 Sudekum et al, 1991 (Article)
Centropyge bispinosa 5.216 (0.824) 0.958 (0.938) -0.066 (0.034) This study
Centropyge flavissima 9.82 (0.668) 0.422 (0.077) -0.21 (0.078) This study
Cephalopholis argus 29.803 (1.204) 0.398 (0.021) -0.252 (0.041) This study
Cephalopholis argus 50.6 0.075 -6.5 Donovan et al, 2013 (Article)
Cephalopholis argus 48.5499 0.049 -14.145 Mapleston et al, 2009 (Report)
Cephalopholis argus 44.22 0.26 1.33 Mehanna et al, 2019 (Article)
Cephalopholis argus 39.901 0.271 -0.169 Pears, 2005 (PhD Thesis)
Cephalopholis argus 37.119 0.339 -0.147 Pears, 2005 (PhD Thesis)
Cephalopholis argus 31.44 0.255 0 Moore et al, 2015b (Report)
Cephalopholis urodeta 20.912 (1.291) 0.142 (0.022) -0.605 (0.101) This study
Cephalopholis urodeta 20.645 0.31 NA Payet et al, 2016 (Article)
Cephalopholis urodeta 14.5 1.39 NA Fry et al, 2006 (Article)
Chaetodon citrinellus 9.07 2.15 -0.074 Berumen et al, 2005 (Article)
Chaetodon ornatissimus 14.523 (0.682) 1.006 (0.143) -0.026 (0.036) This study
Chlorurus spilurus 22.758 (0.834) 1.049 (0.106) -0.023 (0.022) This study
Chlorurus spilurus 34.4 0.4 -0.13 DeMartini et al, 2017 (Article)
Chlorurus spilurus 21.8 0.95 -0.075 Taylor and Choat, 2014 (Article)
Chromis iomelas 5.002 (0.35) 1.297 (0.235) -0.052 (0.021) This study
Chromis viridis 11.961 (1.086) 0.949 (0.236) -0.049 (0.05) This study
Ctenochaetus marginatus 20.748 (1.626) 0.428 (0.047) -0.133 (0.043) This study
Ctenochaetus striatus 17.1 (0.385) 0.851 (0.053) -0.045 (0.022) This study
Ctenochaetus striatus 17.2 0.75 -0.4 Trip et al, 2008 (Article)
Ctenochaetus striatus 18.2 0.5 -0.6 Trip et al, 2008 (Article)
Ctenochaetus striatus 17.6 1.4 -0.2 Trip et al, 2008 (Article)
Ctenochaetus striatus 17.8 0.7 -0.4 Trip et al, 2008 (Article)
Ctenochaetus striatus 15.9 0.5 -0.7 Trip et al, 2008 (Article)
Ctenochaetus striatus 12.8 0.6 -0.7 Trip et al, 2008 (Article)
Ctenochaetus striatus 19.4 1 -0.3 Trip et al, 2008 (Article)
Ctenochaetus striatus 17.1 0.9 -0.4 Trip et al, 2008 (Article)
Ctenochaetus striatus 20.1 0.8 -0.3 Trip et al, 2008 (Article)
Ctenochaetus striatus 19.9 0.3 -0.8 Trip et al, 2008 (Article)
Ctenochaetus striatus 23.2 1.3 -0.2 Trip et al, 2008 (Article)
Ctenochaetus striatus 20.5 2.1 -0.1 Trip et al, 2008 (Article)
Ctenochaetus striatus 18.5 1.1 -0.3 Trip et al, 2008 (Article)
Ctenochaetus striatus 18.8 0.4 -0.6 Trip et al, 2008 (Article)
Ctenochaetus striatus 19.4 0.4 -0.7 Trip et al, 2008 (Article)
Ctenochaetus striatus 16.8 0.591 -0.27 Choat and Robertson, 2002 (Article)
Ctenochaetus striatus 13.2 0.66 -0.16 Fidler et al, 2018 (Article)
Ctenochaetus striatus 11.9 0.72 -0.12 Fidler et al, 2018 (Article)
Ctenochaetus striatus 12.5 0.49 -0.36 Fidler et al, 2018 (Article)
Ctenochaetus striatus 11.9 0.72 -0.12 Fidler et al, 2018 (Article)
Ctenochaetus striatus 12.6 0.69 -0.05 Fidler et al, 2018 (Article)
Ctenochaetus striatus 11.9 0.72 -0.12 Fidler et al, 2018 (Article)
Ctenochaetus striatus 17 0.9 0.2 Ochavillo et al, 2011 (Article)
Ctenochaetus striatus 25.6 0.424 -0.643 Ralston and Williams, 1988 (Report)
Ctenochaetus striatus 16.92 0.63 0 Moore et al, 2013a (Report)
Ctenochaetus striatus 15.75 1.09 0 Moore et al, 2013b (Report)
Ctenochaetus striatus 16.8 0.98 0 Moore et al, 2015a (Report)
Ctenochaetus striatus 15.05 1.318 0 Moore et al, 2015b (Report)
Dascyllus aruanus 5.588 (0.21) 0.966 (0.102) -0.05 (0.025) This study
Dascyllus flavicaudus 8.948 (0.433) 0.504 (0.058) -0.153 (0.057) This study
Epibulus insidiator 23.788 (1.344) 0.542 (0.067) -0.123 (0.052) This study
Epibulus insidiator 19.894 0.25 -0.172 Hubble, 2003 (PhD Thesis)
Epinephelus fasciatus 20.4 (1.7) 0.718 (0.112) -0.038 (0.029) This study
Epinephelus fasciatus 28.1814 0.405 -0.685 Mapleston et al, 2009 (Report)
Epinephelus fasciatus 28.213 0.469 -0.198 Pears, 2005 (PhD Thesis)
Epinephelus fasciatus 27.46 0.45 -0.212 Pears, 2005 (PhD Thesis)
Epinephelus hexagonatus 21.366 (0.909) 0.634 (0.069) -0.068 (0.042) This study
Epinephelus merra 17.617 (0.752) 0.859 (0.058) -0.045 (0.018) This study
Epinephelus merra 21.2 0.5 -0.009 Pothin et al, 2004 (Article)
Epinephelus merra 16.46 1.01 0 Moore et al, 2013a (Report)
Epinephelus polyphekadion 38.026 (1.93) 0.299 (0.034) -0.25 (0.093) This study
Epinephelus polyphekadion 44.71 0.251 -0.14 Rhodes et al, 2011 (Article)
Epinephelus polyphekadion 57.9 0.18 0 Grandcourt, 2005 (Article)
Epinephelus polyphekadion 56.58 0.139 -1.18 Ohta et al, 2017 (Article)
Epinephelus polyphekadion 56.2345 0.194 -0.081 Mapleston et al, 2009 (Report)
Epinephelus polyphekadion 53.701 0.195 -0.245 Pears, 2005 (PhD Thesis)
Epinephelus polyphekadion 58.237 0.206 -0.212 Pears, 2005 (PhD Thesis)
Gnathodentex aureolineatus 20.182 (0.846) 0.546 (0.074) -0.156 (0.081) This study
Halichoeres trimaculatus 17.9 (1.669) 0.653 (0.146) -0.034 (0.055) This study
Lutjanus fulvus 23.923 (0.93) 0.671 (0.083) -0.087 (0.053) This study
Lutjanus fulvus 26.5 0.41 -0.49 Shimose and Nanami, 2014 (Article)
Lutjanus fulvus 20.34 1.306 0 Moore et al, 2015b (Report)
Lutjanus fulvus 23.62 0.735 0 Moore et al, 2015b (Report)
Lutjanus gibbus 35.13 0.29 -1 Moore, 2019 (Article)
Lutjanus gibbus 39.05 0.21 -1.88 Nanami et al, 2010 (Article)
Lutjanus gibbus 30.34 0.256 -3.05 Nanami et al, 2010 (Article)
Lutjanus gibbus 54.4 0.06 -9.48 Heupel et al, 2010b (Article)
Lutjanus gibbus 35.2 0.51 NA Currey et al, 2010 (Report)
Lutjanus gibbus 27.4 0.78 -0.24 Holloway et al, 2015 (Article)
Lutjanus gibbus 34 0.38 0 Moore et al, 2013a (Report)
Lutjanus gibbus 29.35 0.44 0 Moore et al, 2013a (Report)
Lutjanus gibbus 28.47 0.53 0 Moore et al, 2013b (Report)
Lutjanus gibbus 26.5 0.57 0 Moore et al, 2013b (Report)
Lutjanus gibbus 30.5 0.57 0 Moore et al, 2015a (Report)
Lutjanus gibbus 26.7 0.83 0 Moore et al, 2015a (Report)
Lutjanus gibbus 32.48 0.547 0 Moore et al, 2015b (Report)
Lutjanus gibbus 26.67 0.729 0 Moore et al, 2015b (Report)
Lutjanus kasmira 34 0.29 -1.37 Morales-Nin and Ralston, 1990 (Article)
Lutjanus kasmira 29.6 0.384 -1.349 Ralston and Williams, 1988 (Report)
Lutjanus kasmira 22.37 0.6 0 Moore et al, 2013a (Report)
Lutjanus kasmira 19.75 0.91 0 Moore et al, 2013a (Report)
Mulloidichthys flavolineatus 25.761 (0.56) 1.601 (0.112) -0.008 (0.009) This study
Mulloidichthys flavolineatus 38 0.27 -1.15 Mehanna et al, 2017 (Article)
Myripristis berndti 20.118 (0.718) 0.418 (0.032) -0.236 (0.052) This study
Naso lituratus 29.808 (1.729) 1.846 (0.239) -0.004 (0.009) This study
Naso lituratus 21.2 1.38 -0.2 Taylor et al, 2014 (Article)
Naso lituratus 20.4 0.93 -0.3 Taylor et al, 2014 (Article)
Naso lituratus 27.05 0.92 0 Moore et al, 2013a (Report)
Naso lituratus 23.22 1.05 0 Moore et al, 2013a (Report)
Naso lituratus 26.59 0.79 0 Moore et al, 2013b (Report)
Naso lituratus 23.43 1.11 0 Moore et al, 2013b (Report)
Naso lituratus 23.2 1.1 0 Moore et al, 2015a (Report)
Naso lituratus 19.9 1.92 0 Moore et al, 2015a (Report)
Naso lituratus 23.77 1.171 0 Moore et al, 2015b (Report)
Naso lituratus 20.72 2.055 0 Moore et al, 2015b (Report)
Naso unicornis 47.8 0.44 -0.12 Andrews et al, 2016 (Article)
Naso unicornis 47.1 0.36 -0.14 Taylor et al, 2014 (Article)
Naso unicornis 49.3 0.22 -0.48 Taylor et al, 2014 (Article)
Naso unicornis 38.577 0.489 -0.14 Choat and Robertson, 2002 (Article)
Odonus niger 25.093 (1.24) 0.459 (0.053) -0.14 (0.05) This study
Ostorhinchus angustatus 7.195 (0.349) 0.69 (0.089) -0.109 (0.036) This study
Ostorhinchus apogonoides 8.241 (0.217) 0.836 (0.052) -0.073 (0.014) This study
Plectropomus laevis 71.842 (3.023) 0.318 (0.03) -0.194 (0.056) This study
Plectropomus laevis 101.5 0.19 0 Grandcourt, 2005 (Article)
Plectropomus laevis 115.9 0.096 -2.28 Heupel et al, 2010a (Article)
Pristiapogon taeniopterus 8.024 (0.283) 0.779 (0.069) -0.094 (0.027) This study
Sargocentron microstoma 16.26 (0.56) 0.657 (0.054) -0.056 (0.028) This study
Scarus psittacus 17.21 1.19 -0.05 Choat and Robertson, 2002 (Article)
Scarus psittacus 32.7 0.486 -0.01 DeMartini et al, 2017 (Article)
Scarus psittacus 21.7 1.653 -0.29 Page, 1998 (Report)
Scarus psittacus 20.7 0.91 -0.083 Taylor and Choat, 2014 (Article)
Siganus argenteus 30.309 (3.329) 0.614 (0.135) -0.056 (0.054) This study
Siganus argenteus 27.4 0.9 -0.3 Taylor et al, 2016 (Article)
Stegastes nigricans 12.04 (0.789) 0.403 (0.072) -0.2 (0.114) This study
Zebrasoma scopas 13.282 0.425 -0.49 Choat and Robertson, 2002 (Article)

4.1.2 Plot

# 1. Comparison of VBGF parameters between our study and literature ----

vbgf_literature %>% 
  select(Species, Linf, K, t0, Reference) %>% 
  pivot_longer(c("Linf", "K", "t0"), names_to = "Parameter", values_to = "Estimate") %>% 
  mutate(Estimate = as.numeric(Estimate),
         Type = "Literature") %>% 
  bind_rows(., read.csv("./../data/03_back-calculated_vbgf_predictions_sp.csv") %>% 
                select(-Est.Error, -Q2.5, -Q97.5) %>% 
                mutate(Parameter = str_replace_all(Parameter, c("linf" = "Linf",
                                                                "k" = "K")),
                       Type = "This study",
                       Reference = "This study")) %>% 
  mutate(Species = as.factor(Species),
         Parameter = factor(Parameter, levels = c("Linf", "K", "t0"))) %>% 
  ggplot(data = ., aes(x = reorder(Species, desc(Species)), y = Estimate, color = Type)) +
    geom_point() +
    facet_wrap(~Parameter, scales = "free") +
    coord_flip() +
    labs(x = NULL, y = "Value") +
    theme(axis.text.y = element_text(face = "italic"))
Figure 8. Comparison of VBGF growth parameters estimated through Bayesian framework on species back-calculated data, with parameters from literature.

Figure 8. Comparison of VBGF growth parameters estimated through Bayesian framework on species back-calculated data, with parameters from literature.

4.2 Growth curves

# 1. Get predictions from literature data ----

vbgf_literature_pred <- vbgf_literature %>% 
  # Complete missing Age_max
  filter(is.na(Age_max)) %>% 
  left_join(., vbgf_literature %>% 
              group_by(Species) %>% 
              summarise(Age_max2 = max(Age_max, na.rm = TRUE)) %>% 
              mutate(Age_max2 = na_if(Age_max2, -Inf))) %>% 
  mutate(Age_max = ifelse(is.na(Age_max), Age_max2, Age_max)) %>% 
  select(-Age_max2) %>% 
  bind_rows(., vbgf_literature %>% 
              filter(!(is.na(Age_max)))) %>% 
  arrange(Species) %>% 
  # Fix missing t0 to 0
  dplyr::mutate(t0 = ifelse(is.na(t0), 0, t0)) %>% 
  filter(!(is.na(K)), !(is.na(Linf)), !(is.na(t0))) %>% 
  mutate_at(c("Linf", "K", "t0"), as.numeric) %>% 
  filter(Species %in% unique(read.csv("./../data/03_back-calculated_vbgf_fitted_sp.csv")$Species)) %>% 
  # Make the predictions
  dplyr::mutate(Line = row_number()) %>% 
  group_by(Line) %>% 
  do(pred_vbgf(data = .))

# 2. Make the plot ----

plot_final <- read.csv("./../data/03_back-calculated_vbgf_fitted_sp.csv") %>% 
  filter(Species %in% unique(vbgf_literature_pred$Species)) %>% 
  ggplot(data = .) +
  geom_line(data = vbgf_literature_pred, aes(x = Agei, y = Li, group = as.factor(Line), 
                                             text = Reference), color = "#6c7a89", size = 0.7) +
  geom_ribbon(aes(x = age, ymin = ypred_lq, ymax = ypred_uq), alpha = 0.5, fill = col_fill_graph) +
  geom_line(aes(x = age, y = ypred_m), size = 0.7, color = col_color_graph) +

  facet_wrap(~Species, ncol = 4, scales = "free") +
  labs(x = "Age (years)", y = "Length (cm)") +
  theme(strip.text.x = element_text(face = "italic")) +
  lims(y = c(0, NA), x = c(0, NA)) +
  guides(colour = guide_legend(override.aes = list(alpha = 1, size = 0.5)))

plot_final
Figure 9. Comparison of growth curves based on VBGF growth parameters estimated through Bayesian framework on species back-calculated data with growth curves from literature.

Figure 9. Comparison of growth curves based on VBGF growth parameters estimated through Bayesian framework on species back-calculated data with growth curves from literature.

# 4. Convert to plotly ----

plot_final <- plot_final +
  theme(legend.position = "none")

ggplotly(plot_final, tooltip = c("Reference", "Location", "Size_type"))

Figure 10. Comparison of growth curves based on VBGF growth parameters estimated through Bayesian framework on species back-calculated data with growth curves from literature (interactive plot).

4.3 Maximum age

# 1. Comparison of the maximum age between our study and literature ----

vbgf_literature %>% 
  filter(!(is.na(Age_max))) %>% 
  group_by(Species) %>% 
  summarise(Age_max = max(Age_max)) %>% 
  ungroup() %>% 
  left_join(., vbgf_literature) %>% 
  select(Species, Age_max, Reference) %>% 
  right_join(., data_complete %>% 
                  mutate(Lcpt = Lcpt/10) %>% 
                  filter(!(is.na(Agecpt))) %>% 
                  group_by(Species) %>% 
                  summarise(Agecpt = max(Agecpt)) %>% 
                  ungroup()) %>% 
  select(Species, Agecpt, Age_max, Reference) %>% 
  arrange(Species) %>%
  mutate(Agecpt = as.numeric(as.character(Agecpt)),
         Age_max = as.numeric(as.character(Age_max))) %>% 
  mutate(Species = cell_spec(Species, "html", color = "black"),
         Agecpt = cell_spec(Agecpt, "html", color = "black"),
         Age_max = cell_spec(Age_max, "html", color = ifelse(is.na(Age_max), "white", "black")),
         Reference = cell_spec(Reference, "html", color = ifelse(is.na(Reference), "white", "black"))) %>% 
  kable(., 
        format = "html", escape = FALSE,
        col.names = c("Species", "Age max.", "Age max.", "Reference"),
        caption = "Table 7. Comparison of maximum age (Age max.) between this study and litterature. When value of Age max. from literature is missing for one species, it can be either due to unspecified maximum age in the reference or absent value in literature for the considered species.") %>%
  kable_styling(bootstrap_options = c("striped", "hover")) %>% 
  column_spec(1, italic = T) %>%
  add_header_above(c(" " = 1, "This Study" = 1, "Litterature" = 2))
Table 7. Comparison of maximum age (Age max.) between this study and litterature. When value of Age max. from literature is missing for one species, it can be either due to unspecified maximum age in the reference or absent value in literature for the considered species.
This Study
Litterature
Species Age max. Age max. Reference
Abudefduf sexfasciatus 13 NA NA
Acanthurus achilles 27 NA NA
Acanthurus lineatus 23 42 Gust et al, 2002 (Article)
Acanthurus nigricans 9 NA NA
Acanthurus pyroferus 19 NA NA
Acanthurus triostegus 12 NA NA
Balistapus undulatus 18 NA NA
Caranx melampygus 15 6 Sudekum et al, 1991 (Article)
Centropyge bispinosa 11 NA NA
Centropyge flavissima 27 NA NA
Cephalopholis argus 21 39 Mapleston et al, 2009 (Report)
Cephalopholis urodeta 17 12 Payet et al, 2016 (Article)
Chaetodon citrinellus 6 7 Berumen et al, 2005 (Article)
Chaetodon ornatissimus 10 NA NA
Cheilinus chlorourus 6 NA NA
Chlorurus spilurus 16 11 DeMartini et al, 2017 (Article)
Chromis iomelas 5 NA NA
Chromis viridis 9 NA NA
Ctenochaetus marginatus 13 NA NA
Ctenochaetus striatus 17 37 Trip et al, 2008 (Article)
Dascyllus aruanus 7 NA NA
Dascyllus flavicaudus 13 NA NA
Epibulus insidiator 16 16 Hubble, 2003 (PhD Thesis)
Epinephelus fasciatus 13 21 Mapleston et al, 2009 (Report)
Epinephelus hexagonatus 14 NA NA
Epinephelus merra 17 6 Pothin et al, 2004 (Article)
Epinephelus merra 17 6 Moore et al, 2013a (Report)
Epinephelus polyphekadion 20 44 Mapleston et al, 2009 (Report)
Gnathodentex aureolineatus 17 NA NA
Gymnosarda unicolor 7 NA NA
Halichoeres trimaculatus 5 NA NA
Lutjanus fulvus 21 34 Shimose and Nanami, 2014 (Article)
Lutjanus gibbus 1 38 Moore, 2019 (Article)
Lutjanus kasmira 30 6 Moore et al, 2013a (Report)
Lutjanus kasmira 30 6 Moore et al, 2013a (Report)
Monotaxis grandoculis 20 NA NA
Mulloidichthys flavolineatus 6 6 Mehanna et al, 2017 (Article)
Myripristis berndti 24 NA NA
Naso lituratus 10 20 Moore et al, 2013a (Report)
Naso lituratus 10 20 Moore et al, 2013a (Report)
Naso lituratus 10 20 Moore et al, 2013b (Report)
Naso lituratus 10 20 Moore et al, 2013b (Report)
Naso unicornis 17 50 Andrews et al, 2016 (Article)
Odonus niger 16 NA NA
Ostorhinchus angustatus 6 NA NA
Ostorhinchus apogonoides 7 NA NA
Parupeneus barberinus 6 NA NA
Plectropomus laevis 22 16 Heupel et al, 2010a (Article)
Pristiapogon taeniopterus 8 NA NA
Sargocentron microstoma 13 NA NA
Scarus psittacus 6 6 DeMartini et al, 2017 (Article)
Scarus psittacus 6 6 Taylor and Choat, 2014 (Article)
Siganus argenteus 13 NA NA
Siganus spinus 3 NA NA
Stegastes albifasciatus 8 NA NA
Stegastes nigricans 13 NA NA
Zebrasoma scopas 24 NA NA

5. Annex

# 1. Merge the tables on growth parameters by species and by species and location in one table ----

table_final <- read.csv("./../data/03_back-calculated_vbgf_predictions_sp.csv") %>% 
  mutate(Location = "All") %>% 
  bind_rows(., read.csv("./../data/03_back-calculated_vbgf_predictions_sploc.csv")) %>% 
  select(-Est.Error) %>% 
  pivot_wider(names_from = Parameter, names_glue = "{Parameter}_{.value}", values_from = c(Estimate, Q2.5, Q97.5)) %>% 
  arrange(Species, Location) %>% 
  select(Species, Location, linf_Estimate, linf_Q2.5, linf_Q97.5, k_Estimate, k_Q2.5, k_Q97.5,
         t0_Estimate, t0_Q2.5, t0_Q97.5) %>% 
  group_by(Species) %>% 
  mutate(n = n()) %>% 
  filter(n > 2 | Location == "All")

# Ajouter le n indi. (et le n n points ?) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Reproducibility

# 1. Reproducibility ----

sessionInfo()
## R version 4.0.1 (2020-06-06)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 18363)
## 
## Matrix products: default
## 
## locale:
## [1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252   
## [3] LC_MONETARY=French_France.1252 LC_NUMERIC=C                  
## [5] LC_TIME=French_France.1252    
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] rfishbase_3.0.4     plotly_4.9.2.1      readxl_1.3.1       
##  [4] formattable_0.2.0.1 kableExtra_1.1.0    forcats_0.5.0      
##  [7] stringr_1.4.0       dplyr_1.0.0         purrr_0.3.4        
## [10] readr_1.3.1         tidyr_1.1.0         tibble_3.0.1       
## [13] ggplot2_3.3.2       tidyverse_1.3.0     extrafont_0.17     
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_1.0.4.6      lubridate_1.7.9   lattice_0.20-41   assertthat_0.2.1 
##  [5] digest_0.6.25     R6_2.4.1          cellranger_1.1.0  backports_1.1.7  
##  [9] reprex_0.3.0      evaluate_0.14     highr_0.8         httr_1.4.1       
## [13] pillar_1.4.4      rlang_0.4.6       curl_4.3          lazyeval_0.2.2   
## [17] data.table_1.12.8 rstudioapi_0.11   extrafontdb_1.0   blob_1.2.1       
## [21] rmarkdown_2.3     labeling_0.3      webshot_0.5.2     htmlwidgets_1.5.1
## [25] munsell_0.5.0     broom_0.5.6       compiler_4.0.1    modelr_0.1.8     
## [29] xfun_0.14         pkgconfig_2.0.3   htmltools_0.5.0   tidyselect_1.1.0 
## [33] fansi_0.4.1       viridisLite_0.3.0 crayon_1.3.4      dbplyr_1.4.4     
## [37] withr_2.2.0       grid_4.0.1        nlme_3.1-148      jsonlite_1.6.1   
## [41] Rttf2pt1_1.3.8    gtable_0.3.0      lifecycle_0.2.0   DBI_1.1.0        
## [45] magrittr_1.5      scales_1.1.1      cli_2.0.2         stringi_1.4.6    
## [49] farver_2.0.3      fs_1.4.1          xml2_1.3.2        ellipsis_0.3.1   
## [53] generics_0.0.2    vctrs_0.3.1       gh_1.1.0          tools_4.0.1      
## [57] glue_1.4.1        crosstalk_1.1.0.1 hms_0.5.3         yaml_2.2.1       
## [61] colorspace_1.4-1  rvest_0.3.6       memoise_1.1.0     knitr_1.28       
## [65] haven_2.3.1

Jeremy WICQUART | | 2020-08-17 07:23:46